package com.ndp.fb.rdb.db.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ndp.fb.rdb.api.BmAppRdbService;
import com.ndp.fb.rdb.db.DaoTemplate;
import com.ndp.fb.rdb.db.impl.mapper.DefaultRowMapper;
import com.ndp.fb.rdb.model.BusinessManagerApp;

import java.util.List;

/**
 * Created by Evan on 12/7/2015.
 */
@Service
public class BmAppRdbServiceImpl extends DaoTemplate implements BmAppRdbService {

    @Override
    public List<BusinessManagerApp> find(Long fbBussinessId, Long fbUserId)
    {
        String sql = "SELECT * FROM  business_app  WHERE 1=1 AND fb_user_id =? AND fb_business_id =?";
        return getJdbcTemplate().query(sql, new Object[]{fbUserId, fbBussinessId}, DefaultRowMapper.autoRowMapper(BusinessManagerApp.class));
    }

}
